home *** CD-ROM | disk | FTP | other *** search
- head 1.3;
- branch ;
- access ;
- symbols ;
- locks ; strict;
- comment @@;
-
-
- 1.3
- date 90.06.27.11.18.41; author shirriff; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 89.01.05.18.00.04; author ouster; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 89.01.05.17.18.31; author ouster; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.3
- log
- @Fixed typo in man page.
- @
- text
- @.\" @@(#)getenv.3 6.4 (Berkeley) 3/20/87
- .\"
- .TH GETENV 3 "March 20, 1987"
- .AT 3
- .SH NAME
- getenv, setenv, unsetenv \- manipulate environmental variables
- .SH SYNOPSIS
- .nf
- .B char *getenv(name)
- .B char *name;
- .PP
- .B void setenv(name, value)
- .B char *name, *value;
- .PP
- .B void unsetenv(name)
- .B char *name;
- .fi
- .SH DESCRIPTION
- \fIGetenv\fP searches the environment list (see \fIenviron\fP(7))
- for a string of the form \fIname\fP\fB=\fP\fIvalue\fP and returns
- a pointer to the string \fIvalue\fP if such a string is present,
- and 0 (NULL) if it is not.
- .PP
- \fISetenv\fP searches the environment list as \fIgetenv\fP does; if
- the string \fIname\fP is not found, a string of the form
- \fIname\fP\fB=\fP\fIvalue\fP is added to the environment. If it is
- found, its value is changed to
- \fIvalue\fP.
- .PP
- \fIUnsetenv\fP removes all occurrences of the string \fIname\fP from
- the environment. There is no library provision for completely removing
- the current environment. It is suggested that the following code be
- used to do so.
- .PP
- .nf
- static char *envinit[1];
- extern char **environ;
- environ = envinit;
- .fi
- .SH SEE ALSO
- csh(1), sh(1), execve(2), environ(7)
- @
-
-
- 1.2
- log
- @Changed setenv documentation from UNIX form to Sprite form.
- @
- text
- @d13 1
- a13 1
- .B char *name, value;
- d27 1
- a27 1
- found, and \fIoverwrite\fP is non-zero, its value is changed to
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d12 1
- a12 1
- .B setenv(name, value, overwrite)
- a13 1
- .B int overwrite;
- d28 1
- a28 3
- \fIvalue\fP. \fISetenv\fP returns 0 on success and -1 on failure,
- where failure is caused by an inability to allocate space for the
- environment.
- a39 3
- .PP
- All of these routines permit, but do not require, a trailing equals
- (``='') sign on \fIname\fP or a leading equals sign on \fIvalue\fP.
- @
-